from django.contrib.auth import views as auth_views
from django.urls import path

from . import views

app_name = 'account'
urlpatterns = [
    # 个人中心
    path('profile/', views.profile, name='profile'),

    # 登录认证码
    path('verify_code/', views.verify_code, name='verify_code'),

    path('user/active/<token>/', views.activate_user_account, name='activate_user_account'),

    # 登录注册
    path('register/', views.register, name='register'),
    path('login/',
         views.LoginView.as_view(template_name='account/login.html', extra_context={'title': '登录'}),
         name='login'
         ),
    path('logout/', auth_views.LogoutView.as_view(template_name='account/logout.html'), name='logout'),

    # 密码重置
    path('password_reset/', views.PasswordResetView.as_view(), name='password_reset'),
    path('password_reset/done/',
         auth_views.PasswordResetDoneView.as_view(template_name='account/password_reset_done.html'),
         name='password_reset_done'),
    path('reset/<uidb64>/<token>/',
         views.PasswordResetConfirmView.as_view(),
         name='password_reset_confirm'),
    path('reset/done/',
         auth_views.PasswordResetCompleteView.as_view(template_name='account/password_reset_complete.html'),
         name='password_reset_complete'),

    # 更改密码
    path('password_change/', views.PasswordChangeView.as_view(), name='password_change'),
    path('password_change/done/',
         auth_views.PasswordChangeDoneView.as_view(template_name='account/password_change_done.html'),
         name='password_change_done'),
]
